<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: select2-css" />
	<th:block th:include="include :: header('新增客户')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-customer-add">
			<div class="form-group">	
				<label class="col-sm-3 control-label">名称：</label>
				<div class="col-sm-8">
					<input id="name" name="name" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">负责人：</label>
				<div class="col-sm-8">
					<input id="manager" name="manager" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">客户状态：</label>
				<div class="col-sm-8">
					<div class="input-group" style="width: 100%">
	                    <select name="status" class="form-control m-b" th:with="type=${@dict.getType('crm_customer_status')}">
		                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
		                </select>
	                </div>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">客户类型：</label>
				<div class="col-sm-8">
					<div class="input-group" style="width: 100%">
	                    <select name="type" class="form-control m-b" th:with="type=${@dict.getType('crm_customer_type')}">
		                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
		                </select>
	                </div>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">客户级别：</label>
				<div class="col-sm-8">
					<div class="input-group" style="width: 100%">
	                    <select name="level" class="form-control m-b" th:with="type=${@dict.getType('crm_customer_level')}">
		                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
		                </select>
	                </div>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">客户来源：</label>
				<div class="col-sm-8">
					<div class="input-group" style="width: 100%">
	                    <select name="source" class="form-control m-b" th:with="type=${@dict.getType('crm_customer_source')}">
		                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
		                </select>
	                </div>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">所属行业：</label>
				<div class="col-sm-8">
					<div class="input-group" style="width: 100%">
	                    <select name="industryId" class="form-control m-b" th:with="type=${@industry.list()}">
		                    <option th:each="dict : ${type}" th:text="${dict.name}" th:value="${dict.id}"></option>
		                </select>
	                </div>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">联系电话：</label>
				<div class="col-sm-8">
					<input id="phone" name="phone" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">网站：</label>
				<div class="col-sm-8">
					<input id="website" name="website" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">联系地址：</label>
				<div class="col-sm-8">
					<input id="addr" name="addr" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">补充说明：</label>
				<div class="col-sm-8">
					<textarea name="remark" autocomplete="off" maxlength="500" class="form-control" rows="3"></textarea>
				</div>
			</div>
		</form>
	</div>
    <div th:include="include::footer"></div>
    <th:block th:include="include :: select2-js" />
    <script type="text/javascript">
		var prefix = ctx + "crm/customer"
		$("#form-customer-add").validate({
			rules:{
				name:{
					required:true,
				},
			},
			focusCleanup: true
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	            $.operate.save(prefix + "/add", $('#form-customer-add').serialize());
	        }
	    }
	</script>
</body>
</html>
